<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>练习</title>
</head>

<body>

    <div>
        <p>
            
        </p>
    </div>
</body>
<script>
    var i = 10;

    function fn() {
        var i = 10;
        return function (n) {
            console.log(n + (++i))
        }
    }
    f = fn();
    f(10);//21
    f(20);//32
    fn()(10);//21
    fn()(20);//31
    console.log(f);
    console.log(fn);
</script>

</html>